<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="/WEB-INF/taglib/jstl.jsp" %>

<div style="overflow:hidden;">
	<div class="fnList" style="padding-right:8px; border-right:1px solid gray;">
		<div class="grpFnMgrForm">
			<div style="width:97%;text-align:left;">
				<div style="clear:both; width:100%; border:1px dotted blue; padding:2px 0 2px 10px;">
					<div style="clear:both; width:100%; height:12px;">
						<div style="float:left; width:10px; height:10px; border:1px solid #000; background-color:#b9b9b9; 
							font-size:8px; font-weight:bold; text-align:center; margin:0 0 0 4px;">V</div>
						<div style="float:left; margin:0 0 0 2px;">&nbsp;: A condition for collapsing the tree.</div>
					</div>
	
					<div style="clear:both; width:100%; height:12px;">
						<div class="red-font" style="float:left;">(H)</div>
						<div style="float:left;">&nbsp;: Highest Level (Unable to put it under the others.)</div>
					</div>
	
					<div style="clear:both; width:100%; height:12px;">
						<div class="red-font" style="float:left;">(P)</div>
						<div style="float:left;">&nbsp;: Private Group (Unable to move on somewhere.)</div>
					</div>	
				</div>

				<div style="clear:both; width:100%; margin:5px 0 0 0; border:1px dotted blue; padding:2px 0 2px 10px;">
					<div style="clear:both;">
						설정옵션:&nbsp;
						<input type="radio" name="soptRadio" id="sort" value="0" checked="checked" /> 정렬
						&nbsp;&nbsp;
						<input type="radio" name="soptRadio" id="rwx" value="1" /> 권한[R(2) + W(2) + X(2)]
					</div>
	
					<div style="clear:both;">
						<input type="button" id="jqwSelectedReleaseBtn" value="선택 해제" />
						&nbsp;&nbsp;
						<c:if test="${sysBase.sysChmod >= 6}">
							<input type="button" id="jqwFormSaveBtn" value="설정 저장" />
						</c:if>
						<input type="button" id="jqwCloseBtn" value="닫기" />
					</div>
				</div>
			</div>

			<div style="width:100%; margin:5px 0 0 0; border:1px solid #eeeeee;">
				<div style="height:375px; overflow-y:auto;">
					<form id="frmGrpFnMgr"></form>
				</div>
			</div>
		</div>
	</div>
		
	<div class="fnInfo"><!-- height:465px -->
		<div class="grpFnMgrFormView" style="width:460px; height:195px; padding-top:2px; padding-left:2px; border:1px dotted blue;">
			<span>왼쪽 기능을 클릭하면 기능 정보를 볼수 있습니다.</span>
		</div>
		<div style="width:95%; height:4px;"></div>
		
		<div style="width:100%;">
			<div>그룹에 추가 가능한 기능 목록</div>
			<div><span class="red-font">(H) </span>최상위 레벨에 존재해야 하는 기능 표시.</div>
			<div><span class="red-font">(P) </span>특정 그룹에만 사용되는 기능 표시.</div>
		</div>
		<div style="width:100%; height:230px;">
			<div style="width:100%; height:25px; border:0px solid red;">
				<table class="left-table" style="width:460px; table-layout:fixed;word-wrap:break-word;">
				<tr>
					<th class="first" style="width:61px;">기능코드</th>
					<th style="width:110px;">기능이름</th>
					<th style="width:215px;">Servlet Url</th>
					<th style="width:30px;">사용</th>
					<th class="last" style=" width:42px;"></th>
				</tr>
				</table>
			</div>
			<div style="width:100%; height:200px; overflow-y:auto; border:0px solid blue; border-bottom:0px solid gray;">
				<table class="left-table" id="notMappingFnList" style="width:460px; table-layout:fixed;word-wrap:break-word;">
				<c:choose>
				<c:when test="${not empty notMappingList}">
					<c:forEach var="items" items="${notMappingList}" varStatus="i">
					<tr>
						<td style="padding-left:2px; width:59px;">${items.fnId}</td>
						<td style="padding-left:2px; width:108px;">
							<div style="float:left;"></div>
							<div class="red-font" style="float:left;"><c:if test="${items.fnHighestLevlYN eq 'Y'}">(H)&nbsp;</c:if></div>
							<div class="red-font" style="float:left;"><c:if test="${items.fnHideYN eq 'Y'}">(P)&nbsp;</c:if></div>
							<div style="float:left;">${items.fnAlias}</div>
							<div style="float:left; display:none;">${items.fnHighestLevlYN}</div>
							<div style="float:left; display:none;">${items.fnHideYN}</div>
						</td>
						<td style="padding-left:2px; width:213px;">${items.fnServletUrl}</td>
						<td style="padding-left:2px; width:28px;">${items.fnUseYN}</td>
						<td style="text-align:center; width:40px;">
							<c:if test="${sysBase.sysChmod >= 6}">
								<input type="button" name="fnAddBtn" value="추가" />
								<span style="display:none;">${items}</span>
							</c:if> 
						</td>
					</tr>
					</c:forEach>
				</c:when>
				<c:otherwise>
					<tr id='emptyTrMsg'><td width='460' style='text-align:center;'>추가할 기능이 없습니다.</td></tr>
				</c:otherwise>
				</c:choose>
				</table>
			</div>
		</div>

		<div id="grpFnMgrInfo" style="display:none;">${mappingList}</div>
		<div id="grpFnMgrId" style="display:none;">${grpFnMgrId}</div>
	</div>
</div>

<!-- 자바 스크립트 -->
<script type="text/javascript" src="/resources/js/views/template/system/group/sortable-1.1.js"></script>
<script type="text/javascript" src="/resources/js/views/template/system/group/_fnMgrForm.js"></script>